package com.wx.datastructure.linked;

/**
 * @author wx
 * @Description: 单向链表测试
 * @date 2018/12/17 001711:17
 */
public class LinkedMain {
    public static void main(String[] agrs){
      ILinked<String>  linkedList = new LinkedList<>();
        linkedList.add(0,"wx");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList);
        System.out.println("####################");
        linkedList.add(1,"wang");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList);
        System.out.println("####################");
        linkedList.add(0,"wangx");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList);
        System.out.println("####################");
        linkedList.add(1,"wangxx");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList);
        System.out.println("####################");
        System.out.println(linkedList.contains("wxx"));
        linkedList.set(2,"wxx");
        System.out.println(linkedList.contains("wxx"));
        System.out.println(linkedList);
        System.out.println("####################");
        System.out.println(linkedList.removeFirst());
        System.out.println(linkedList);
        System.out.println("####################");
        System.out.println(linkedList.removeLast());
        System.out.println(linkedList);
        System.out.println("####################");
        linkedList.add(1,"wxxx");
        System.out.println(linkedList);
        linkedList.removeElement("wxxx");
        System.out.println(linkedList);
    }
}
